package notRelevantAnymore;
/*package parsing;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class parserCityCountryTextFile {

	
    public static int GetCountryIDFromCode (String str) {
    	str=str.toUpperCase();
        int a = str.charAt(0);
        int b = str.charAt(1);
       

        a <<= 8;
        b |= a;

        return b;
    }
    
    public static void CountryContinentParser(String outputfilePath, String InputFilePath) throws IOException{
    
    	        // write to file "urls.text" the web pages in the WebGraph
    	        File file = new File(outputfilePath);
    	        file.createNewFile();
    	        FileWriter fw = new FileWriter(file.getAbsoluteFile());
    	        BufferedWriter bw = new BufferedWriter(fw);
    	        //get file path
    	        File filePath = new File(InputFilePath);
    	        Scanner scanner = new Scanner(filePath);
    	      String firstLine=  scanner.nextLine();
    	        while(scanner.hasNext()){
    	            String currLine = scanner.nextLine();
    	            String[] lineParts;
    	         
    	                lineParts = currLine.split(",");
    	                
    	       	                if (lineParts.length!=5){
    	                	

    	                	continue;
    	                }
    	       	             System.out.println(lineParts[1] + ' '+lineParts[2] + ' ' + lineParts[4] );
    	             for (int i=1; i< lineParts.length;i++){
    	            	 if (i==3||i==1){
    	            		 int id= parserCityCountryTextFile.GetCountryIDFromCode(lineParts[i]);
    	            		 
    	            		 bw.write(id + "\t");
    	            	 }else{
    	            		String curr=lineParts[i];
    	            		
    	            			curr=curr.replaceAll("^\"|\"$", "");
    	            		//System.out.println(curr);
    	            		 bw.write(curr + "\t");
    	            	 }
    	             }
    	             bw.write("\n");
    	             
    	     
    	                }
    	                bw.write("\n");

    	

    	        scanner.close();
    	        //fw.close();
    	        bw.close();
    	    }
    
    public static void CityParser(String outputfilePath, String InputFilePath) {
    	  File file = new File(outputfilePath);
	        try {
				file.createNewFile();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	        FileWriter fw=null;
			try {
				fw = new FileWriter(file.getAbsoluteFile());
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	        BufferedWriter bw = new BufferedWriter(fw);
	        //get file path
	        BufferedReader br = null;
	      
	           try {
				br = new BufferedReader(new FileReader(new File(InputFilePath)));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	      try {
			br.readLine();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	        
	     //   File filePath = new File(InputFilePath);
	   //     Scanner scanner = new Scanner(filePath);
	       // scanner.nextLine();
	       
	      //  while(scanner.hasNext()){
	      String currLine=null;
	      try {
			currLine=br.readLine();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	      while(currLine!=null){
	           // String currLine = br.nextLine();
	    //	  String currLine = scanner.nextLine();
	            String[] lineParts;
	         	                lineParts = currLine.split(",");
	             
	             for (int i=0; i< lineParts.length;i++){
	            	 if (i==0){
	            		 int id= parserCityCountryTextFile.GetCountryIDFromCode(lineParts[i]);
	            		 try {
							bw.write(id + "\t");
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
	            	 }else if (i==2||i==3||i==4){
	            		 continue;
	            	 }
	            	 else{
	            		String curr=lineParts[i];
	            		
	            			curr=curr.replaceAll("^\"|\"$", "");
	            		
	            		 try {
							bw.write(curr + "\t");
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
	            	 }
	             }
	             try {
					bw.write("\n");
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
	             
	             try {
					currLine=br.readLine();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
	                }
	                try {
						bw.write("\n");
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
	                try {
						br.close();
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
	      //  scanner.close();
	        try {
				bw.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	    }
    }

*/